import request from '@/utils/request'
/**
 * 接口
 */
export default {

  // 1.讲师列表(条件查询分页)
  /**
   *
   * @param {*} current 当前页
   * @param {*} limit   每页的记录数
   * @param {*} teacherQuery  条件对象
   * @returns
   */
  getTeacherListPage(current,limit,teacherQuery) {
    return request({
      // url: '/eduservice/edu-teacher/pageTeacherCondition/'+current+"/"+limit ,
      url: `/eduservice/edu-teacher/pageTeacherCondition/${current}/${limit}`,
      method: 'post',
      //  teacherQuery在 后端使用RequestBody获取数据json 
      // data 表示将数据转化成json格式
      data: teacherQuery

    })
  },
  /**
   * 删除讲师
   * @param {*} id  讲师id
   * @returns 
   */
  deleteTeacherId(id) {
    return request({
      // url: `${api_name}/${teacherId}`,
      url: `/eduservice/edu-teacher/remove/${id}`,
      method: 'delete'
     })
    },
    /**
     *  添加讲师
     * @param {*} teacher 
     * @returns 
     */
  addTeacher(teacher) {
      return request({
        // url: `${api_name}/${teacherId}`,
        url: `/eduservice/edu-teacher/addTeacher`,
        method: 'post',
        // data 表示将数据转化成json格式
        data: teacher
       })
    },
    /**
     * 查询讲师by ID
     * @param {*} id  
     * @returns 
     */
    getTeacherInfo(id) {
      return request({
        // url: `${api_name}/${teacherId}`,
        url: `/eduservice/edu-teacher/getTeacher/${id}`,
        method: 'get',
       })
    },
    /**
     * 修改讲师
     * @param {*} teacher 
     * @returns 
     */
    updateTeacherinfo(teacher) {
      return request({
        // url: `${api_name}/${teacherId}`,
        url: `/eduservice/edu-teacher/updateById`,
        method: 'post',
        data: teacher
       })
    }

    

}

